package org.shilong.UI.profile;

import java.util.ArrayList;
import java.util.List;

import org.shilong.Model.BusinessCardModel;
import org.shilong.UI.R;

import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.widget.TextView;

public class MyProfileFrame extends Activity {

	private TextView business_card_banner_textivew, show_tele_textview,
			show_com_name_textview, show_business_textivew,
			show_domain_textview, show_sex_textview, show_age_textview;

	public static List<BusinessCardModel> showBusinessCardList = new ArrayList<BusinessCardModel>();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		setContentView(R.layout.new_layout_show_myprofile);
		
		initViews();
		
		initDatas( showBusinessCardList );

	}

	void initViews() {

		business_card_banner_textivew = (TextView) this
				.findViewById(R.id.business_card_banner_textivew);
		business_card_banner_textivew.setText("我的名片");
		

		show_tele_textview = (TextView) this
				.findViewById(R.id.show_tele_num_textview);
		show_com_name_textview = (TextView) this
				.findViewById(R.id.show_com_name_textview);
		show_business_textivew = (TextView) this
				.findViewById(R.id.show_business_textview);
		show_domain_textview = (TextView) this
				.findViewById(R.id.show_domain_textview);
		show_sex_textview = (TextView) this
				.findViewById(R.id.show_sex_textview);
		show_age_textview = (TextView) this
				.findViewById(R.id.show_age_textview);


	}

	/**
	 * 为textivew初始化数据
	 * 
	 * @param list
	 */
	private void initDatas(List<BusinessCardModel> list) {

		BusinessCardModel model = list.get(0);

		show_tele_textview.setText(Html.fromHtml("<u>"
				+ model.getTelephone_number() + "</u>"));
		show_com_name_textview.setText(Html.fromHtml("<u>"
				+ model.getCompany_name() + "</u>"));
		show_business_textivew.setText(Html.fromHtml("<u>"
				+ model.getBussiness() + "</u>"));
		show_domain_textview.setText(Html.fromHtml("<u>" + model.getDomain()
				+ "</u>"));
		show_age_textview
		.setText(Html.fromHtml("<u>" + model.getAge() + "</u>"));
		show_sex_textview
		.setText(Html.fromHtml("<u>" + model.getSex() + "</u>"));

	}
}
